@echo off
setlocal

@REM Set the path of the directory to check
set "rootPath=%CD%\"
set "dist=%rootPath%\target\dist"

@REM Check if the directory exists
if exist "%dist%" (
    rmdir /s /q "%dist%"
    echo delete dist dir :%dist%
)
mkdir %dist%

copy .\run.bat %dist%
copy %rootPath%\target\learn-spring-boot-2.0-SNAPSHOT.jar %dist%\ROOT.jar

set "outFile=%rootPath%\target\admin.zip"


powershell -command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('%dist%', '%outFile%')"


endlocal
